<template>
	<div class="addProject business-workAdd">
		<div class="addForm zll-form">
			<el-form :model="addForm" :rules="rules" ref="addForm" class="demo-ruleForm">
				<el-row :gutter="40">
					<el-col :span="8">
						<el-form-item class="formList" prop="data9" label="采购号：">
							<el-input clearable class="input_right" v-model="addForm.procureCode" disabled></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="40">
					<el-col :span="8">
						<el-form-item class="formList" prop="data1" label="采购类型：">
							<el-select clearable class="input_right" v-model="addForm.procureType" disabled>
								<el-option label="合同" value="1"></el-option>
								<el-option label="报销" value="2"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item class="formList" prop="data2" label="大类：">
							<el-select clearable class="input_right" v-model="addForm.processName" disabled>
								<el-option label="1" value="1"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item class="formList" prop="data3" label="采购日期：">
							<el-input clearable class="input_right" v-model="addForm.procureTime" disabled></el-input>
						</el-form-item>
						<el-form-item class="formList" prop="data4" label="供应商：">
							<el-input clearable class="input_right" v-model="addForm.supplier"
									  disabled></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item class="formList" prop="data5" label="状态：">
							<el-input clearable class="input_right" v-model="addForm.procureStatusCn" disabled></el-input>
						</el-form-item>
						<el-form-item class="formList" prop="data6" label="采购人：">
							<el-input clearable class="input_right" v-model="addForm.procureUser"
									  disabled></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<div class="tableList" style="margin-top: 0;">
					<table border="1">
						<tr>
							<th>品类</th>
							<th>物料代码</th>
							<th>物料名称</th>
							<th>品牌/规格</th>
							<th>单位</th>
							<th>数量</th>
							<th>单价</th>
							<th>合计</th>
						</tr>
						<tr class="add_Table">
							<td><p>{{ addForm.itemAlias }}</p></td>
							<td><p>{{ addForm.materialCode }}</p></td>
							<td><p>{{ addForm.materialName }}</p></td>
							<td><p>{{ addForm.materialGrade }}</p></td>
							<td><p>{{ addForm.measureUnit }}</p></td>
							<td><p>{{ addForm.procureCount }}</p></td>
							<td><p>{{ addForm.procurePrice }}</p></td>
							<td><p>{{ addForm.procureTotalPrice }}</p></td>
						</tr>
					</table>
				</div>
				<div class="nav_list">
					<div class="_title">
						<span><i class="iconfont icon-ruku"></i>到货入库</span>
					</div>
					<div class="tableList" style="margin-top: 0;">
						<table border="1">
							<tr>
								<th>入库号</th>
								<th>入库时间</th>
								<th>入库数量</th>
								<th>备注</th>
								<th>入库人</th>
							</tr>
							<tr class="add_Table" v-for="(item,index) in storageHistorys" :key="index">
								<td><p>{{item.procureStorageCode}}</p></td>
								<td><p>{{item.createTimeFt}}</p></td>
								<td><p>{{item.storageCount}}</p></td>
								<td><p>{{item.remark}}</p></td>
								<td><p>{{item.storageUserName}}</p></td>
							</tr>
						</table>
					</div>
				</div>
				<div class="nav_list">
					<div class="_title">
						<span><i class="iconfont icon-gongxiangtuopaniconshangchuan-"></i>结算支付</span>
					</div>
					<el-row :gutter="40">
						<el-col :span="8">
							<el-input clearable class="input_right" v-model="addForm.payStatusCn"
									  disabled></el-input>
						</el-col>
						<el-col :span="8" :offset="8">
							<el-form-item class="formList" prop="data22" label="确认人：">
								<el-input clearable class="input_right" v-model="addForm.surePayUser"
										  disabled></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</div>
			</el-form>
		</div>
	</div>
</template>
<script>

	export default {
		props: ['editData', 'type'],
		data() {
			return {
				jsDialog: false,
				addForm: {

				},
				storageHistorys:[],
				rules: {

				}
			}
		},
		methods: {
			getProcureStorageHistoryList() {
				let self = this;
				self.$http({
					url: "/jinl/procureStorage/getProcureStorageHistoryList",
					method: "post",
					params:{id:self.addForm.id}
				}).then(resp => {
					if (resp.success) {
						self.storageHistorys =  JSON.parse(JSON.stringify(resp.result));
						return;
					}
					self.$message.error(resp.message)
				});
			},
		},

		watch:{
			editData(val) {
				console.log('======editData=========')
				console.log(val)
				this.addForm = val;
				this.getProcureStorageHistoryList();
			},
		},


		mounted() {
		},
		components: {},
	}
</script>
<style lang="scss" scoped>
	@import "@/style/dialog.scss";

	.formList {
		margin-bottom: 8px !important;
	}

	.nav_list {
		margin-top: 20px;

		._title {
			line-height: 40px;
			color: #00D1D0;
			display: flex;
			justify-content: space-between;

			i {
				font-size: 16px;
				margin-right: 5px;
			}

			.void {
				margin-left: 20px;
				height: 26px;
				line-height: 26px;
				padding: 0 20px;
			}
		}

		.edit_ {
			color: #409EFF;
			cursor: pointer;
		}
	}

	.edit {
		color: #409EFF;
		cursor: pointer;
	}
</style>